import request from '@/utils/request'

// 下拉小区
export function getSelectHomeApi() {
  return request({
    url: '/community',
    method: 'get'
  })
}
// 活动管理
export function getInitDataApi(data) {
  return request({
    url: '/service/activity',
    method: 'GET',
    params: {
      ...data
    }
  })
}
// 图片转化

export function uploadPicApi(data) {
  return request({
    url: '/base/upload?field=activity',
    method: 'POST',
    data
  })
}
// 添加项目
export function addDataApi(data) {
  return request({
    url: '/service/activity',
    method: 'POST',
    data
  })
}
// 删除
export function delDataApi(id) {
  return request({
    url: `/service/activity/${id}`,
    method: 'DELETE'

  })
}
// 修改
export function editDataApi(data) {
  return request({
    url: `/service/activity/${data.id}`,
    method: 'PUT',
    data
  })
}
// 获取详情
export function getDetailDataApi(id) {
  return request({
    url: `/service/activity/${id}`,
    method: 'GET'

  })
}

// 获取投诉
export function getComplainDataApi(data) {
  return request({
    url: `/service/complain`,
    method: 'GET',
    params: {
      ...data
    }
  })
}

// 回复投诉详情

export function getComplainDetailApi(id) {
  return request({
    url: `/service/complain/${id}`,
    method: 'GET'
  })
}
// 回复修改投诉
export function editComplainApi(data) {
  return request({
    url: `/service/complain/${data.id}`,
    method: 'PUT',
    data
  })
}
// 删除投诉
export function delComplainApi(id) {
  return request({
    url: `/service/complain/${id}`,
    method: 'DELETE'

  })
}

// 获取报修
export function getRepairDataApi(data) {
  return request({
    url: `/service/repair`,
    method: 'GET',
    params: {
      ...data
    }
  })
}

// 回复报修详情
export function getRepairDetailApi(id) {
  return request({
    url: `/service/repair/${id}`,
    method: 'GET'
  })
}
// 回复修改报修
export function editRepairApi(data) {
  return request({
    url: `/service/repair/${data.id}`,
    method: 'PUT',
    data
  })
}
// 删除报修
export function delRepairApi(id) {
  return request({
    url: `/service/repair/${id}`,
    method: 'DELETE'

  })
}
// 信箱接口
// 获取表单数据
export const getMailboxApi = params => request({
  method: 'GET',
  url: '/service/mailbox',
  params
})

// 删除
export const delMailboxApi = id => request({
  method: 'DELETE',
  url: `/service/mailbox/${id}`
})
// 详情
export const getMailboxDetailApi = id => request({
  method: 'GET',
  url: `service/mailbox/${id}`
})
// 编辑
export const editMailboxApi = data => request({
  method: 'PUT',
  url: `service/mailbox/${data.id}`,
  data
})
